<?php namespace App\Core\Repository;

trait Sortable{
    
    protected $sortHandle;
    
    public function getSortHandle(){
        return $this->sortHandle;
    }
    
    public function setSortHandle(Sort $handle){
        $this->sortHandle = $handle;
        $this->sortHandle->boot($this);
        return $this;
    }
    
    public function applySort(){
        $this->getSortHandle()->sort();
        return $this;
    }
}